package dimensional.traveler.client.screens.cinematic;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

import dimensional.traveler.client.UserManagement;
import dimensional.traveler.client.mvc.MediatedController;
import dimensional.traveler.client.services.MissionService;
import dimensional.traveler.client.services.MissionServiceAsync;
import dimensional.traveler.shared.model.missionSequence.MissionSequence;

public class CinematicController extends MediatedController {

	private MissionServiceAsync missionService = GWT.create(MissionService.class);
	
	public void endCinematic() {
		missionService.getNextMissionSequence(UserManagement.getLoggedInUser(), new AsyncCallback<MissionSequence>() {
			
			@Override
			public void onSuccess(MissionSequence result) {
				mediator.displayMissionSequence(result);
			}
			
			@Override
			public void onFailure(Throwable caught) {
				handleRequestFailure(caught);
			}
		});
	}

}
